package com.stlm2.dems.entity;

/**
 * Author：fuchunyu
 * Date：2017/11/8
 * Description：
 */
public class Nearby implements Comparable<Nearby>{
    private Integer id;
    private Integer distance;
    public Nearby(Integer id, Integer distance){
        this.id=id;
        this.distance=distance;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getDistance() {
        return distance;
    }

    public void setDistance(Integer distance) {
        this.distance = distance;
    }

    @Override
    public int compareTo(Nearby o) {
        if(this.distance>o.getDistance()){
            return 1;
        }
        else if(this.distance<o.getDistance()){
            return -1;
        }
        else{
            return 0;
        }
    }


}
